package com.sangmo.fts.process.receivable.service;

import com.sangmo.boot.framework.plugin.dataview.crud.service.BaseViewService;
import com.sangmo.boot.framework.plugin.dataview.data.IDataViewRepo;
import com.sangmo.fts.process.receivable.model.RpfContractItem;
import com.sangmo.fts.process.receivable.repo.RpfContractItemRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RpfContractItemEntityService extends BaseViewService<RpfContractItem> {

    @Autowired
    private RpfContractItemRepo rpfContractItemRepo;

    @Override
    protected IDataViewRepo<RpfContractItem> getRepo() {
        return rpfContractItemRepo;
    }

    public List<RpfContractItem> saveAll(List<RpfContractItem> contractItems) {
        return rpfContractItemRepo.saveAll(contractItems);
    }

    public List<RpfContractItem> findByContractId(Long contractId) {
        return rpfContractItemRepo.findByContractId(contractId);
    }
}
